<?php
include $this->Render('header.php');
?>
<link rel="stylesheet" type="text/css" href="<?php echo BASE_STYLE;?>/css/admin.css" />
<script type="text/javascript" src="<?php echo BASE_STYLE;?>/js/dyhl.linkpage.js"></script>
<script type="text/javascript" src="<?php echo BASE_STYLE;?>/js/common.js"></script>

<div class="tongrong-box" style="width:680px;">
	<form class="login-box-form J-ajaxForm" action="<?php echo $this->id > 0 ? '/setting/auupdate/option/ausave/' : '/setting/ausave/option/ausave/';?>" method="post" autocomplete="off">
	<div class="tongrong-box-main">
    	<table width="100%" cellpadding="0" cellspacing="0" border="0">
        	<tr>
            	<td width="90px" height="30">权限编号：</td>
                <td>
                	<input name="au_code" type="text" id="au_code" size="35" value="<?php echo $this->data['au_code'];?>" />
                </td>
            </tr>
            <tr>
            	<td height="30">审核级别：</td>
                <td>
					<input name="au_level" type="text" id="au_code" size="35" value="<?php echo $this->data['au_level'];?>" />
                </td>
            </tr>
            <tr>
            	<td height="30">审核金额上限：</td>
                <td>
                	<input name="au_ceiling" type="text" id="au_ceiling" size="35" value="<?php echo $this->data['au_ceiling'];?>" />万
                </td>
            </tr>
            <tr>
            	<td height="30">备注：</td>
                <td>
                	<textarea name="au_remark" id="au_remark" style="width: 451px; height: 95px;"><?php echo $this->data['au_remark'];?></textarea>
                </td>
            </tr>
            
            
        </table>
    </div>
    <div class="luru-box-btn mt30" style="margin-right:75px;">
		<input type="hidden" name="option" value="save" />
		<input type="hidden" name="id" value="<?php echo $this->id;?>" />
    	<input class="btn-submit-blue fn-left mr15 J-submit" type="submit" value="提交" />
        <a class="a-btn-close J-a-btn-close" href="javascript:;">关闭</a>
    </div>
	</form>
</div>

<script>
	//关闭弹出
	$(".J-a-btn-close").on('click',function(){
		var winElement = parent.Ext.fly(window.frameElement).up('div.x-window');
		parent.Ext.getCmp(winElement.id).close();
	});
	
	$(document).ready(function(e) {
        $(".J-submit").on('click',function(){
			$(this).dyhlForm({
				beforefunction:submitChk,
				nofunction:function(){
					$(".J-submit").prop('disabled',false);
				},
				sucessfunction:function(data){
					$(".J-submit").prop('disabled',false);
					if(data['success']){
						Ext.Msg.alert('提示','提交成功',function(){
							window.parent.App.store.reload();
							var winElement = parent.Ext.fly(window.frameElement).up('div.x-window');
							parent.Ext.getCmp(winElement.id).close();
						});
					}else{
						Ext.Msg.alert('提示',data['msg']);
					}
				}	
			});	
		});
    });
	
	//表单验证
	function submitChk(){
		if($("#au_code").val() == ''){
			Ext.Msg.alert('提示','权限编号不能为空!');	
			return false;
		}
		
		if($("#au_ceiling").val() == ''){
			Ext.Msg.alert('提示','审核金额上限不能为空!');	
			return false;
		}
		
		$(".J-submit").prop('disabled',true);	
	}
	
</script>

<?php include $this->Render('footer.php'); ?>